using UnityEngine;

public struct MStartSwipe
{
	public Vector3 player1Position;

	public Vector3 player2Position;

	public string hitName;

	public float timeOfhit;

	public bool useDesiredEndPosition;

	public Vector3 desiredEndPosition;

	public int hitType;

	public float currentBallFlightTime;

	public float gameTimescale;

	public int pingTimeMs;

	public Vector3 hitPoint;

	public bool isBallNull;

	public Vector3 ballNullSwipeGesture;

	public bool isChosenHitPlanNull;

	public float framerateScale;

	public void ConvertFromRemoteToLocalSpace()
	{
		player1Position = MultiplayerMatchController.RemoteToLocalPos(player1Position);
		player2Position = MultiplayerMatchController.RemoteToLocalPos(player2Position);
		desiredEndPosition = MultiplayerMatchController.RemoteToLocalPos(desiredEndPosition);
		hitPoint = MultiplayerMatchController.RemoteToLocalPos(hitPoint);
		ballNullSwipeGesture = MultiplayerMatchController.RemoteToLocalPos(ballNullSwipeGesture);
	}

	public void Send(GGNetwork network)
	{
		network.BeginWrite(14);
		network.AddVector3(player1Position);
		network.AddVector3(player2Position);
		network.AddString(hitName);
		network.AddFloat(timeOfhit);
		network.AddBool(useDesiredEndPosition);
		network.AddVector3(desiredEndPosition);
		network.AddInt(hitType);
		network.AddFloat(currentBallFlightTime);
		network.AddFloat(gameTimescale);
		network.AddInt(pingTimeMs);
		network.AddVector3(hitPoint);
		network.AddBool(isBallNull);
		network.AddVector3(ballNullSwipeGesture);
		network.AddBool(isChosenHitPlanNull);
		network.AddFloat(framerateScale);
		network.EndWrite();
		network.Send(true, 0);
	}

	public void Deserialize(GGNetwork network)
	{
		player1Position = network.GetVector3();
		player2Position = network.GetVector3();
		hitName = network.GetString();
		timeOfhit = network.GetFloat();
		useDesiredEndPosition = network.GetBool();
		desiredEndPosition = network.GetVector3();
		hitType = network.GetInt();
		currentBallFlightTime = network.GetFloat();
		gameTimescale = network.GetFloat();
		pingTimeMs = network.GetInt();
		hitPoint = network.GetVector3();
		isBallNull = network.GetBool();
		ballNullSwipeGesture = network.GetVector3();
		isChosenHitPlanNull = network.GetBool();
		framerateScale = network.GetFloat();
	}
}
